package cn.damai.search.baseService.ipml;

import cn.damai.model.Cinema;
import cn.damai.search.baseService.BaseCinemaService;
import cn.damai.search.mapper.CinemaMapper;
import cn.damai.util.DubboUtil;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Component
@Service(version = DubboUtil.VRESION,group = DubboUtil.GROUP)
public class BaseCinemaServiceIpml implements BaseCinemaService {

    @Autowired
    private CinemaMapper cinemaMapper;

    @Override
    public Cinema getCinemaById(@RequestParam("id") Long id){
        return cinemaMapper.getCinemaById(id);
    }

    @Override
    public List<Cinema>	getCinemaListByMap(@RequestParam Map<String,Object> param){
        return cinemaMapper.getCinemaListByMap(param);
    }

    @Override
    public Integer getCinemaCountByMap(@RequestParam Map<String,Object> param){
        return cinemaMapper.getCinemaCountByMap(param);
    }

    @Override
    public Integer qdtxAddCinema(@RequestBody Cinema Cinema){
        Cinema.setCreatedTime(new Date());
        return cinemaMapper.insertCinema(Cinema);
    }

    @Override
    public Integer qdtxModifyCinema(@RequestBody Cinema Cinema){
        Cinema.setUpdatedTime(new Date());
        return cinemaMapper.updateCinema(Cinema);
    }
    
}
